import router from './router/index'
// 白名单
const whiteList = ['/register', '/login', '/layout/home', '/layout/houstList', '/layout/news', '/layout/my', '/cityMap']

router.beforeEach((to, from, next) => {
  const token = localStorage.getItem('MY-HK-TOKEN')
  if (token) {
    next()
  } else {
    if (whiteList.includes(to.path)) {
      next()
    } else {
      next('/login')
    }
  }
})
